gint *width)
{
GtkTreeViewColumnPrivate *priv;
- GdkRectangle zero_cell_area = { 0, };
+ GdkRectangle cell_area;
GdkRectangle allocation;
g_return_val_if_fail (GTK_IS_TREE_VIEW_COLUMN (tree_column), FALSE);
priv = tree_column->priv;
- /* FIXME: Could use a boolean return value for invalid cells */
+ gtk_tree_view_get_background_area (GTK_TREE_VIEW (priv->tree_view),
+ NULL, tree_column, &cell_area);
+
gtk_cell_area_get_cell_allocation (priv->cell_area,
priv->cell_area_context,
priv->tree_view,
cell_renderer,
- &zero_cell_area,
+ &cell_area,
&allocation);
if (x_offset)
- *x_offset = allocation.x;
+ {
+ GdkRectangle button_allocation;
+
+ /* Retrieve column offset */
+ gtk_widget_get_allocation (priv->button, &button_allocation);
+ *x_offset = allocation.x - button_allocation.x;
+ }
if (width)
*width = allocation.width;